package com.imooc.maokeyang.alllearning.domain.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

@Data
@TableName("user")
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class UserDO implements Serializable {

    private static final long serialVersionUID = 912321312312321L;

    private String username;

    private String password;

    private String email;

    private Integer age;

    private String phone;

    @TableField(exist=false)
    private List<RoleDO> roles;



    @TableId(type = IdType.ASSIGN_ID)
    private Long id;

    @TableField(fill = FieldFill.INSERT)
    private LocalDateTime created;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private LocalDateTime modified;


    @TableField(fill = FieldFill.INSERT)
    private String creator;

    @TableField(fill = FieldFill.INSERT_UPDATE)
    private String operator;

    /**
     *  逻辑删除字段  0：正常  1： 删除
     */
    @TableField(fill = FieldFill.INSERT)
    private Integer status;

    @Version
    @TableField(fill = FieldFill.INSERT)
    private Long version;
}
